import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkDarenBrowsingHistoryVO, SkDarenBrowsingHistoryForm, SkDarenBrowsingHistoryQuery } from '@/api/app/SkDarenBrowsingHistory/types';

/**
 * 查询达人浏览记录列表
 * @param query
 * @returns {*}
 */

export const listSkDarenBrowsingHistory = (query?: SkDarenBrowsingHistoryQuery): AxiosPromise<SkDarenBrowsingHistoryVO[]> => {
  return request({
    url: '/app/SkDarenBrowsingHistory/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询达人浏览记录详细
 * @param id
 */
export const getSkDarenBrowsingHistory = (id: string | number): AxiosPromise<SkDarenBrowsingHistoryVO> => {
  return request({
    url: '/app/SkDarenBrowsingHistory/' + id,
    method: 'get'
  });
};

/**
 * 新增达人浏览记录
 * @param data
 */
export const addSkDarenBrowsingHistory = (data: SkDarenBrowsingHistoryForm) => {
  return request({
    url: '/app/SkDarenBrowsingHistory',
    method: 'post',
    data: data
  });
};

/**
 * 修改达人浏览记录
 * @param data
 */
export const updateSkDarenBrowsingHistory = (data: SkDarenBrowsingHistoryForm) => {
  return request({
    url: '/app/SkDarenBrowsingHistory',
    method: 'put',
    data: data
  });
};

/**
 * 删除达人浏览记录
 * @param id
 */
export const delSkDarenBrowsingHistory = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkDarenBrowsingHistory/' + id,
    method: 'delete'
  });
};
